GH-394 Add combat sign editing blocker#394
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a feature to prevent players from editing signs during combat, specifically addressing sign traps that block ender pearl throws. It adds the SignEditingBlocker listener, configuration settings under SignEditingSettings, and corresponding unit tests. The review feedback recommends adjusting the event handler priority to EventPriority.LOW to ensure that other protection plugins (such as WorldGuard) can properly override the interaction states if needed.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| import org.bukkit.event.EventHandler; | ||
| import org.bukkit.event.Event.Result; | ||
| import org.bukkit.event.Listener; |
There was a problem hiding this comment.
Import EventPriority to support setting a lower priority on the event handler.
| import org.bukkit.event.EventHandler; | |
| import org.bukkit.event.Event.Result; | |
| import org.bukkit.event.Listener; | |
| import org.bukkit.event.EventHandler; | |
| import org.bukkit.event.EventPriority; | |
| import org.bukkit.event.Event.Result; | |
| import org.bukkit.event.Listener; |
| @EventHandler | ||
| void onInteract(PlayerInteractEvent event) { |
There was a problem hiding this comment.
To prevent potential bypasses of region protection or other plugins that restrict Ender Pearl usage (e.g., WorldGuard region flags banning pearls), it is highly recommended to run this event handler at a lower priority like EventPriority.LOW. This ensures that SignEditingBlocker sets its default allowed/denied states first, allowing other protection plugins running at NORMAL or higher to override them if necessary.
| @EventHandler | |
| void onInteract(PlayerInteractEvent event) { | |
| @EventHandler(priority = EventPriority.LOW) | |
| void onInteract(PlayerInteractEvent event) { |
No description provided.